<?php
namespace app\task\model;

use think\Model;

class Task extends Model
{
	protected $insert = ['add_time','user_id'];
    protected $update = ['update_time'];
    protected function setUserIdAttr(){
    	return session('admin_id');
    }
    protected function setAddTimeAttr(){
    	return time();
    }
    protected function setUpdateTimeAttr(){
        return time();
    }

    protected static function init(){
    	self::beforeInsert(function($data){
    		$data['status'] = 2;
    		
    	});
    	
    }
   
}
